package ro.dta.idbi.interfaces.ui;

import java.awt.LayoutManager;

import javax.swing.JLabel;
import javax.swing.JPanel;

import uk.ac.ic.doc.automed.reps.Schema;

/**
 * Interface for GUI factories, used to create UI elements
 * 
 * @author Tudor Dobrila
 * 
 */
public interface IGuiFactory {

	/**
	 * Create a title label
	 * 
	 * @param text
	 *            Text to display in the label
	 * @return Title label
	 */
	JLabel createTitleLabel(String text);

	/**
	 * Create the execute transformations dialog
	 * 
	 * @param parentFrame
	 *            Parent frame of the dialog
	 * @param schema
	 *            Schema over which the transformation will be run
	 * @param isTransaction
	 *            True if the transformations should be executed as a
	 *            transaction, false otherwise
	 * @return Execute transformations dialog
	 */
	IExecTransDialog createExecTransDialog(IMainFrame parentFrame, Schema schema,
			boolean isTransaction);

	/**
	 * Create the execute IQL dialog box
	 * 
	 * @param parentFrame
	 *            Parent frame of the application
	 * @param schema
	 *            Schema over which to execute the IQL
	 * @param initialQuery
	 *            Initial IQL query
	 * @return Execute IQL dialog box
	 */
	IExecIqlDialog createExecIqlDialog(IMainFrame parentFrame, Schema schema, String initialQuery);

	/**
	 * Create a panel with a gradient background
	 * 
	 * @param layout
	 *            Layout manager of the panel
	 * @return
	 */
	JPanel createGradientPanel(LayoutManager layout);

	/**
	 * Create a schema chooser panel, used to select a schema
	 * 
	 * @param initialSchema
	 *            Schema initially selected in the chooser panel
	 * @return Schema chooser panel, used to select a schema
	 */
	ISchemaChooser createSchemaChooserPanel(String initialSchema);
}
